home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / COM / MacPPP Control 1.5b2.sit / MacPPP Control 1.5b2 / Check Emailer < prev    next >
Text File  |  1996-03-01  |  3KB  |  93 lines

  1. (*    Check Emailer 0.9 -> Friday, March 1, 1996
  2.  
  3.         Who did it
  4.         ----------
  5.         Jonathan Rentzsch (jonathan@u-s-x.com)
  6.         <http://www.u-s-x.com>
  7.         Copyright ゥ 1996 United Software Express, all rights reserved.
  8.         Based loosely on Mark Alldritt's "Check The Mail" AppleScript which
  9.         does the same thing for Eudora
  10.         
  11.         I would call this Version 1.0, but I'm not completely confident in it. Please
  12.         forward any bug reports. Besides that, the stigma!
  13.         
  14.         What it needs
  15.         -------------
  16.         MacPPP Ctrl 1.1 or later
  17.         Emailer 1.0v2 or later (get the upgrade, for God's sake, it's free)
  18.         
  19.         What it does
  20.         ------------
  21.         Launches Emailer
  22.         If PPP is not active, attempts to activate
  23.         Sends and retrieves all mail for your Internet (TCP-accessable) account(s)
  24.         If PPP was not active when the script began, PPP is closed. Otherwise PPP is left up.
  25.         (This handy when you are already online and you want to blast all your mail)
  26.         
  27.         What YOU need to do
  28.         -------------------
  29.         Scroll down to "--> Your Account" and change "jonathan@u-s-x.com" to your
  30.         "Account Name." Note: Your email address in not necessary your account name!
  31.         Go into Emailer and figure out what your "Account Name" is and use that.
  32.         
  33.         Scroll down to "--> Fast Mac?." If you have errors saying "PPP connection timed out"
  34.         then try replacing the "repeat while ( i < 100 ..." with "repeat while ( i < 200 ...".
  35.         Of course, so completely deserve this hassle since you can afford that 9500.
  36.         
  37.         If you have multiple accounts, scroll down to "--> Your Account" and duplicate the line
  38.         "connect to "jonathan@u-s-x.com" with sending and checking". Now replace the
  39.         "jonathan@u-s-x.com" account name with your next account name. Repeat with how many
  40.         accounts you have. I once had eight different accounts, so this ability is a God-send.
  41.         
  42.         Write and say how you owe me big time for writing this for you.
  43. *)
  44.  
  45. try
  46.     -- Launch Emailer before acivating PPP - saves us that time once we're online
  47.     tell application "Emailer" to activate
  48.     --remember the PPP state before proceeding
  49.     copy (PPPopened) to wasOpened
  50.     --if PPP is not active, activate it
  51.     if not wasOpened then
  52.         activate
  53.         openPPP
  54.         set i to 0
  55.         --> Fast Mac?
  56.         repeat while (i < 100 and not (PPPopened))
  57.             set i to i + 1
  58.         end repeat
  59.         if not (PPPopened) then error "PPP connection timed out"
  60.     end if
  61.     --the PPP is active, blast the mail both ways
  62.     with timeout of 9999 seconds
  63.         tell application "Emailer"
  64.             activate
  65.             --> Your Account
  66.             connect to "jonathan@u-s-x.com" with sending and checking
  67.         end tell
  68.     end timeout
  69.     -- if PPP was not active when we started, kill it now
  70.     if not wasOpened then
  71.         repeat 5 times
  72.             activate
  73.         end repeat
  74.         closePPP
  75.     end if
  76. on error err
  77.     --uh-oh. Bad stuff happened.
  78.     activate
  79.     --if PPP is active because we turned it on, offer to turn it off.
  80.     if (PPPopened) and (not wasOpened) then
  81.         display dialog "Can't check the mail (" & err & ")." & return & return & ツ
  82.             "Close PPP connection?" buttons {"Close", "Don't Close"} default button "Close" with icon caution
  83.         if the button returned of the result is "Close" then
  84.             repeat 5 times
  85.                 activate
  86.             end repeat
  87.             closePPP
  88.         end if
  89.     else
  90.         --otherwise just tell them the bad news
  91.         display dialog "Can't check the mail (" & err & ")." buttons "OK" default button "OK" with icon caution
  92.     end if
  93. end try